//
//  AppUdp.h
//  SiterLib
//
//  Created by tracyhenry on 2022/12/20.
//

#import <Foundation/Foundation.h>
#import "DataModel.h"

@protocol SiterMessegeHandlerDelegate;
@protocol SiterMessegeUpDelegate;
@protocol SiterDiscoverDelegate;

@interface AppUdp : NSObject

@property(nonatomic,strong) NSMutableDictionary *udplist;
-(void)addDelegateHandler:(id<SiterMessegeHandlerDelegate>) delegate;
-(void)removeDelegateHandler:(id<SiterMessegeHandlerDelegate>) delegate;
@property(nonatomic,strong)id<SiterMessegeUpDelegate> delegate;
@property(nonatomic,strong)id<SiterDiscoverDelegate> delegate_discover;
@property(nonatomic,strong) NSMutableArray * delegateList;

+(instancetype)shared;
- (void)initUdp;
- (void)sendBroadcastStart;
- (void)sendBroadcast;
- (void)sendBroadcast:(NSString *)ip;
- (void)sendBroadcastSubsection:(int)num;
- (void)senData:(NSDictionary *)dics witIp:(NSString *)ip;
-(NSMutableDictionary *)getudplist;
@end

@protocol SiterMessegeHandlerDelegate <NSObject>

-(void)deviceHandler:(DataModel *)message;

@end

@protocol SiterMessegeUpDelegate <NSObject>


-(void)deviceNoAlert:(DataModel *)data;

@end


@protocol SiterDiscoverDelegate <NSObject>


-(void)deviceDiscover:(NSString *)mac withIp:(NSString *)ip;

@end
